﻿using Base.Entities.Enums;
using Prism.Services.Dialogs;
using System;
using System.Windows;
using System.Windows.Input;

namespace System
{
    public static class MessageHelper
    {
        /// <summary>
        /// 普通提示
        /// </summary>
        /// <param name="dialogService"></param>
        /// <param name="message"></param>
        /// <param name="callBack"></param>
        public static void ShowNotification(this IDialogService dialogService, string message, Action<IDialogResult> callBack = null)
        {
            dialogService.ShowDialog(DialogTypeEnum.InfoDialog.ToString(), new DialogParameters($"message={message}"), callBack ?? (result => { }));
        }

        /// <summary>
        /// 确认弹窗
        /// </summary>
        /// <param name="dialogService"></param>
        /// <param name="message"></param>
        /// <param name="callBack"></param>
        public static void ShowConfirmation(this IDialogService dialogService, string message, Action<IDialogResult> callBack)
        {
            dialogService.ShowDialog(DialogTypeEnum.ConfirmDialog.ToString(), new DialogParameters($"message={message}"), callBack);
        }

        /// <summary>
        /// Tip弹窗
        /// </summary>
        /// <param name="dialogService"></param>
        /// <param name="message"></param>
        /// <param name="callBack"></param>
        public static void ShowTip(this IDialogService dialogService, string message, Action<IDialogResult> callBack = null)
        {
            dialogService.ShowDialog(DialogTypeEnum.TipDialog.ToString(), new DialogParameters($"message={message}"), callBack ?? (result => { }));
        }

        /// <summary>
        /// 页面弹窗
        /// </summary>
        /// <param name="dialogService"></param>
        /// <param name="message"></param>
        /// <param name="callBack"></param>
        public static void ShowView(this IDialogService dialogService, string viewName, string message, Action<IDialogResult> callBack = null)
        {
            dialogService.ShowDialog(viewName, new DialogParameters($"message={message}"), callBack ?? (result => { }));
        }
    }
}
